package com.resource.loginlogoutmanange.controller;

import java.util.Arrays;
import java.util.Map;

import com.resource.common.utils.AppResponse;
import com.resource.loginlogoutmanange.entity.TLoginInformationEntity;
import com.resource.loginlogoutmanange.service.TLoginInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.resource.common.utils.PageUtils;


/**
 * 登录信息表
 *
 * @author zkx
 * @email 1486664603@qq.com
 * @date 2023-03-06 20:53:55
 */
@RestController
@RequestMapping("manage/tlogininformation")
public class TLoginInformationController {
    @Autowired
    private TLoginInformationService tLoginInformationService;


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public AppResponse info(@PathVariable("id") Long id) {
        TLoginInformationEntity tLoginInformation = tLoginInformationService.getById(id);

        return AppResponse.success("成功",tLoginInformation);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public AppResponse save(@RequestBody TLoginInformationEntity tLoginInformation) {
        tLoginInformationService.save(tLoginInformation);

        return AppResponse.success();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public AppResponse update(@RequestBody TLoginInformationEntity tLoginInformation) {
        tLoginInformationService.updateById(tLoginInformation);

        return AppResponse.success();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public AppResponse delete(@RequestBody Long[] ids) {
        tLoginInformationService.removeByIds(Arrays.asList(ids));

        return AppResponse.success();
    }

}
